Conventionally, a semiconductor device in which an interlayer insulating film is provided on a front surface of a semiconductor substrate is known. Such a semiconductor device is disclosed for example in Patent Literature 1 (Japanese Patent Application Publication No. 2005-136270). The semiconductor device of Patent Literature 1 includes a semiconductor substrate in which a plurality of trench gates is provided, and an interlayer insulating film provided on a front surface of the semiconductor substrate so as to cover the trench gates. The interlayer insulating film is provided with openings (contact holes) through which a part of the front surface of the semiconductor substrate is exposed. Contact plugs are filled in the openings.